;;Sentence Parser

;;Basics: Noun Phrase (NP), Verb Phrase (VP), Prepositional Phrase (PP), Noun,
;;Verb, Modifier (adjectives and adverbs), prepositions, 

;;Data Structure: ( (blah blah blah) ((v) blah) (blah blah) ) words with (v) are verb groups

(defun isVerb (word) "determines whether word is verb or not, input must be a symbol"
    (if (isIncluded word *verblist*)
	t
      
        nil
    )
)

(defun parse-sentence (sentence) "parses sentence simply by splitting it into noun groups and verb groups"
    
    (setq tempsentence sentence)
    (setq parsedsentence sentence)

    ;;find locations of verbs
    (while (!= tempsentence nil) do
	   (setq blah 1)
	   (if (isVerb (car tempsentence))
	      (setq parsedsentence (substitute (list '(v) (car tempsentence)) (car tempsentence) parsedsentence))
	      
	   )
	   
	   (setq tempsentence (cdr tempsentence))
	   
    )
    
    parsedsentence
)

(defun parse-passage (passage) "parses each sentence with parse-sentence function, passage is a list outputted by the function sentence-split"
    (let ((counter 0)
	  (unparsed-passage passage)
	  (parsed-passage '()))
      (while unparsed-passage do
	(setq parsed-passage (left-rotate (cons (group-items (parse-sentence (car unparsed-passage))) parsed-passage)))
	(setq unparsed-passage (cdr unparsed-passage))
      )
      parsed-passage
    )
)